<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<body>
    <input type="text">
    <button>搜索</button>
    <script>
        document.querySelector("button").addEventListener("click",function(){
            let input =document.querySelector("input")
            // 将input的值存放到本地存储
            localStorage.setItem("user",input.value)
            location.href = "2.html"
        })
    </script>
</body>
</html>